<?php
namespace app\admin\controller;

use think\Controller;
use think\Request;

class User extends Controller
{
    public function login(){
        if (!Request::instance()->post('username')){
            // 临时关闭当前模板的布局功能
            $this->view->engine->layout(false);
            return view('login');
        }
    }

    //用户列表
    public function userList()
    {
        $user=new \app\admin\model\User();
        $user_info=$user->info();
        $this->assign(['user_info'=>$user_info]);
        return view();
    }

    public function userData()
    {
        $user=new \app\admin\model\User();
        $user_info=$user->info();
        return json_encode($user_info);
    }

}